package model;

import java.util.Comparator;

public class Provider implements Comparable<Provider>, Comparator<Provider> {
	private String id;
	private String name;
	private String note;

	public Provider(String id, String name, String note) {
		this.id = id;
		this.name = name;
		this.note = note;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Override
	public String toString() {
		return this.name;
	}

	@Override
	public int compareTo(Provider o) {
		if (!this.id.equalsIgnoreCase(o.id))
			return 1;
		return 0;
	}

	@Override
	public int compare(Provider o1, Provider o2) {
		if (o1.id.equalsIgnoreCase(o2.id))
			return 0;
		return 1;
	}

}
